package com.example.exam.controller;

import com.example.exam.util.RespBean;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@RestController
public class ErrorController implements org.springframework.boot.web.servlet.error.ErrorController{


    @Override
    public String getErrorPath() {
        return null;
    }

    @ApiOperation(value = "接收系统错误", notes = "系统出现错误,都会转发到该路径")
    @RequestMapping("/error")
    public RespBean error(HttpServletRequest request, HttpServletResponse response){

        return RespBean.error("不知名错误");
    }
}
